package com.cx.mall.api.cart;


import com.cx.mall.common.model.cart.Cart;
import com.cx.mall.common.utils.ResponseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "Cart", value = "mall-cart-service")
public interface CartFeign {
    @PostMapping("/save")
    public ResponseVO add(@RequestBody Cart cart);

    @GetMapping(value = "/list/{userId}")
    public ResponseVO<List<Cart>> list(@PathVariable("userId") String userId);

    @DeleteMapping(value = "/{id}")
    public ResponseVO delete(@PathVariable("id") String id);

    @DeleteMapping("/cart/deleteByIds")
    public ResponseVO deleteByIds(@RequestBody List<String> ids);
}
